package com.unitd.base.frame.plugin.db.datasource.sqls;

import lombok.Getter;

/**
 * 添加数据源sql
 *
 * @author Hudan
 * @version 1.0
 * @filename AddDatabaseInfoSql.java
 * @copyright www.unitd.com
 * @date 2020-06-28
 */
@Getter
public class AddDatabaseInfoSql extends AbstractSql {

    @Override
    protected String mysql() {
        return "insert into `sys_datasource` (`id`, `db_type`, `db_name`, `jdbc_driver`, `jdbc_url`, `user_name`, `password`, `status`, `delete_flag`, `create_time`, `update_time`, `remark`) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
    }

    @Override
    protected String sqlServer() {
        return "insert into [sys_datasource] ([id], [db_type], [db_name], [jdbc_driver], [jdbc_url], [user_name], [password], [status], [delete_flag], [create_time], [update_time], [remark]) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
    }

    @Override
    protected String pgSql() {
        return "insert into sys_datasource (id, db_type, db_name, jdbc_driver, jdbc_url, user_name, password, status, delete_flag, create_time, update_time, remark) values (?, ?, ?, ?, ?, ?, ?, ?, ?, to_timestamp(?,'YYYY-MM-DD HH24:MI:SS'), to_timestamp(?,'YYYY-MM-DD HH24:MI:SS'), ?)";
    }

    @Override
    protected String oracle() {
        return "insert into sys_datasource (id, db_type, db_name, jdbc_driver, jdbc_url, user_name, password, status, delete_flag, create_time, update_time, remark) values (?, ?, ?, ?, ?, ?, ?, ?, ?, to_date(?,'yyyy-mm-dd hh24:mi:ss'), to_date(?,'yyyy-mm-dd hh24:mi:ss'), ?)";
    }
}